<template>
	<div>
	<yd-preview :buttons="[]">
        <yd-preview-header>
            <div slot="left" v-if="data.type == 'income'">收入金额</div>
            <div slot="left" v-if="data.type == 'preincome'">预计金额</div>
            <div slot="right">¥{{data.total_price}}</div>
        </yd-preview-header>

        <yd-preview-item v-if="data.type == 'income'">
            <div slot="left">分佣时间</div>
            <div slot="right">{{data.hexiao_time}}</div>
        </yd-preview-item>
        <yd-preview-item>	
            <div slot="left">产品</div>
            <div slot="right">{{data.title}}</div>
        </yd-preview-item>
        <yd-preview-item>
            <div slot="left">型号</div>
            <div slot="right">{{data.attr_name}}</div>
        </yd-preview-item>

        <yd-preview-item>
            <div slot="left">购买者</div>
            <div slot="right"> 
            	<img slot="icon" :src="data.uid_headimg"  width="24" height="24"> 
            	{{data.uid_nickname}}
            </div>
        </yd-preview-item>

        <yd-preview-item v-if="data.type == 'preincome'">
            <div slot="left">购买数量</div>
            <div slot="right">{{data.ynum}}</div>
        </yd-preview-item>

        <yd-preview-item>
            <div slot="left">下单时间</div>
            <div slot="right">{{data.create_time}}</div>
        </yd-preview-item>


        <!-- 如果是一级 -->
        <yd-preview-item v-if="userdata.fx_level == '1'">
            <template v-if="data.nickname1 == undefined">
                 <div slot="left">来自分销商</div>
                 <div slot="right">自己</div>
            </template>

            <template v-if="data.nickname1 != undefined">
                <div slot="left">来自分销商</div>
                <div slot="right">
                    <img slot="icon" :src="data.headimg1"  width="24" height="24"> 
                    {{data.nickname1}}
                    <span v-if="data.type == 'income'"> , 他的佣金：{{data.two_price}}</span>
                </div>
            </template>

        </yd-preview-item>

        <!-- 如果是最高权限 -->
        <yd-preview-item v-if="userdata.fx_level == '999' ">
            <template v-if="data.nickname == undefined">
                <div slot="left">来自分销商</div>
                <div slot="right">商城</div>
            </template>

            <template v-if="data.nickname != undefined">
                <div slot="left">来自分销商</div>
                <div slot="right">
                    <img slot="icon" :src="data.headimg"  width="24" height="24"> 
                    {{data.nickname}}
                    <span v-if="data.type == 'income'"> , 他的佣金：{{data.one_price}}</span>
                </div>
            </template>
            
        </yd-preview-item>


        

    </yd-preview>


    <!-- 最高权限,实际收入明细 -->
    <yd-preview class="mt10" :buttons="[]" v-if="data.type == 'income' && userdata.level == '1'">
    	<yd-preview-header>
            <div slot="left" v-if="data.type == 'income'">
            	<span class="h5">
            		收入金额 = 用户支付金额 - 一级分佣 - 二级分佣 <br>
            		  - 微信手续费 - 群盟产品成本
            	</span>
            </div>
            <!-- <div slot="right">¥{{data.total_price}}</div> -->
        </yd-preview-header>

    	<yd-preview-item>
            <div slot="left">用户支付</div>
            <div slot="right"> 
            	{{data.total_guide}}
            </div>
        </yd-preview-item>

    	<yd-preview-item>
            <div slot="left">
            	<img slot="icon" :src="data.uid_headimg"  width="24" height="24"> 
            	[一级]{{data.uid_nickname}}
            </div>
            <div slot="right"> 
            	{{data.one_price}}
            </div>
        </yd-preview-item>

        <yd-preview-item v-if="data.uid_nickname1 != undefined">
            <div slot="left">
            	<img slot="icon" :src="data.uid_headimg1"  width="24" height="24"> 
            	[二级]{{data.uid_nickname1}}
            </div>
            <div slot="right"> 
            	{{data.two_price}}
            </div>
        </yd-preview-item>

        <yd-preview-item>
            <div slot="left">微信手续费</div>
            <div slot="right"> 
            	{{data.sxf_price}}
            </div>
        </yd-preview-item>

        <!-- <yd-preview-item>
            <div slot="left">群盟手续费</div>
            <div slot="right"> 
            	{{data.sys_price}}
            </div>
        </yd-preview-item> -->

        <yd-preview-item>
            <div slot="left">群盟产品成本</div>
            <div slot="right"> 
            	{{data.profit_wb}}
            </div>
        </yd-preview-item>



    </yd-preview>

	
	

	<!-- <div class="profit" @click="profitinfo">
	

	订单名：{{profitdata.title}}<br>
	型号：{{profitdata.attr_name}} <br>
	下单时间：{{profitdata.create_time}}<br>
	核销时间：{{profitdata.hexiao_time}}<br>

	价格：{{profitdata.total_guide}}<br>
	佣金：{{profitdata.total_price}}<br>

	<img :src="profitdata.headimg" width="50" height="50" >
	一级微信：{{profitdata.nickname}}<br>
	一级分佣：{{profitdata.one_price}}<br>
	<img :src="profitdata.uid_headimg1" width="50" height="50" >
	二级微信：{{profitdata.nickname1}}<br>
	二级分佣：{{profitdata.two_price}}<br>
	<img :src="profitdata.uid_headimg" width="50" height="50" >
	购买者：{{profitdata.uid_nickname}}<br> -->
		<!-- <div class="productimg">
			<img v-bind:src="imgurl" >
		</div>
		<div class="title">{{productobj.name}}</div>
		<div class="info red">
			¥ <span style="font-size:18px;">{{productobj.guide_price}}</span>
		</div> -->

	<!-- </div> -->
</div>
</template>

<script>

import { mapGetters } from 'vuex';

//preincome, income
	
export default {

	name : 'profitinfo',

	data () {

		return {


		}

	},

	

	computed : {
		...mapGetters([
			'company_code',
			'userdata',
		]),

		data () {
			return this.$route.query;
		}
	},

	methods : {
		
	},

	create () {
		console.log('akakakkakaka');
	}

}


</script>

<style scoped>


</style>